<template>
  <div>
    <br>
    <el-row>
      <el-col span="4">
        <el-button type="success" size="small">新增员工</el-button>
      </el-col>
      <el-col span="10">
        <span>所在部门：</span>
         <el-select v-model="crop" placeholder="请选择所在部门">
            <el-option v-for="item in cropList" :key="item.cropId" :label="item.cropName" :value="item.cropId"></el-option>
         </el-select>
      </el-col>
      <el-col span="6">
          姓名：
          <el-input style="width: 120px;" placeholder="请输入姓名"></el-input>
      </el-col>
      <el-col span="4">
        <el-button type="success" size="small" @click="query">查询</el-button>
      </el-col>
    </el-row>
    <el-table
      :data="peopleList"
      stripe
      style="width: 100%">
      <el-table-column
        prop="userid"
        label="工号"
        width="80">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        width="80">
      </el-table-column>
      <el-table-column
        prop="cropName"
        width="100"
        label="所在部门">
      </el-table-column>
      <el-table-column
        prop="workskyll"
        width="120"
        label="所在岗位">
      </el-table-column>
      <el-table-column
        prop="phone"
        width="100"
        label="手机号码">
      </el-table-column>
      <el-table-column
        prop="address"
        width="80"
        label="地址">
      </el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        >
        <template slot-scope="scope">
          <el-row>
            <el-button icon="el-icon-search" circle size="small">详情</el-button>
            <el-button type="primary" icon="el-icon-edit" circle size="small">编辑</el-button>
            <el-button type="danger" icon="el-icon-delete" circle size="small">删除</el-button>
          </el-row>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      :current-page="params.page"
      :page-size="params.size"
      style="float: right;"
      layout="prev, pager, next"
      @current-change="changePage"
      :total="total">
    </el-pagination>
  </div>
</template>

<script>
  import ElRow from "element-ui/packages/row/src/row";

  export default {
    components: {
      ElRow
    },
    data() {
      return {
        peopleList: [{
          userid: '1',
          name: '张三',
          cropName: '华为手机组装部 ',
          workskyll: '屏幕组装工',
          phone: '15626358943',
          address: '文澜2',
        },
          {
            userid: '2',
            name: '李四',
            cropName: '小米手机组装部 ',
            workskyll: '听筒组装工',
            phone: '15626358943',
            address: '文韬5',
          },
          {
            userid: '3',
            name: '王五',
            cropName: 'vivo手机组装部 ',
            workskyll: '主板组装工',
            phone: '15626358943',
            address: '文瀛2',
          },
          {
            userid: '4',
            name: '赵六',
            cropName: 'opp手机组装部 ',
            workskyll: 'cup组装工',
            phone: '15626358943',
            address: '田园5',
          },
          {
            userid: '5',
            name: '小明',
            cropName: '苹果手机组装部 ',
            workskyll: '电池组装工',
            phone: '15626358943',
            address: '东区2',
          },
        ],
        personName: '',
        crop: '',
        cropList: [],
        total: 50,
        params: {
          page: 1,
          size: 5
        }
      };
    }
  };
</script>

<style>


</style>
